<template>
  <el-dialog
    v-model="userStore.queryMechanismInfoShow"
    :before-close="close"
    title="查看机构信息"
    width="40%"
  >
    <el-form label-width="100px">
      <el-form-item label="机构名称">
        <el-input :value="mechanismInfo.jgmc" :disabled="true" style="width: 90%" />
      </el-form-item>
      <el-form-item label="机构性质">
        <el-input :value="mechanismInfo.jgxz" :disabled="true" style="width: 90%" />
      </el-form-item>
      <el-form-item label="地址">
        <el-input :value="mechanismInfo.jgdz" :disabled="true" style="width: 90%" />
      </el-form-item>
      <el-form-item label="力量等级">
        <el-input :value="mechanismInfo.lldj" :disabled="true" style="width: 90%" />
      </el-form-item>
      <el-form-item label="机构状态">
        <el-input :value="mechanismInfo.jgzt" :disabled="true" style="width: 90%" />
      </el-form-item>
      <el-form-item label="值班电话">
        <el-input :value="mechanismInfo.txzbsDh" :disabled="true" style="width: 90%" />
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button type="primary" class="confirm" @click="confirm">确认</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useUserStore, useLoginInfoStore } from '@/store'

const userStore = useUserStore()
const loginInfoStore = useLoginInfoStore()

defineProps({
  mechanismInfo: {
    type: Object,
    default: () => {
      return {}
    },
  },
})

/** 取消 */
const close = () => {
  userStore.queryMechanismInfoShow = false
}

/** 确认 */
const confirm = () => {
  userStore.queryMechanismInfoShow = false
}
</script>

<style lang="scss" scoped>
.confirm {
  width: 90px;
  border-color: #209dbe;
  background-color: #209dbe;
}

.dialog-footer {
  text-align: center;
}

::v-deep .el-form-item__label {
  font-weight: 700;
}

::v-deep .el-input.is-disabled .el-input__inner {
  color: #333;
}
</style>
